package com.gusha.model;

import java.io.Serializable;
import java.math.BigInteger;
import java.util.Date;
import javax.persistence.*;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;


/**
 * @Created：2018-11-08 10:07:03
 * @Author LightSound的代码生成器
 * @Description:InfoQuestion实体类
 */
@Entity
@Table(name="info_question")
@NamedQuery(name="InfoQuestion.findAll", query="SELECT i FROM InfoQuestion i")
@DynamicInsert
@Data
@NoArgsConstructor
@AllArgsConstructor
public class InfoQuestion implements Serializable {

    private static final long serialVersionUID = 1L;
    
    @Id
    @GeneratedValue(strategy=GenerationType.IDENTITY)    
    private BigInteger id;
    
    //用户ID
    @ManyToOne(fetch=FetchType.LAZY)
   	@NotFound(action=NotFoundAction.IGNORE)
   	@JoinColumn(name="user_id")
    private User user;
    
    //问题ID
    @Column(name="question_id")
    private BigInteger questionId;
    
    //问答内容
    @Column(name="question_answer")
    private String questionAnswer;
    
    //创建时间
    @Temporal(TemporalType.TIMESTAMP)
    @Column(name="create_time")
    private Date createTime;
    
    //更改时间
    @Temporal(TemporalType.TIMESTAMP)
    @Column(name="update_time")
    private Date updateTime;

	public BigInteger getId() {
		return id;
	}

	public void setId(BigInteger id) {
		this.id = id;
	}

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public BigInteger getQuestionId() {
		return questionId;
	}

	public void setQuestionId(BigInteger questionId) {
		this.questionId = questionId;
	}

	public String getQuestionAnswer() {
		return questionAnswer;
	}

	public void setQuestionAnswer(String questionAnswer) {
		this.questionAnswer = questionAnswer;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public Date getUpdateTime() {
		return updateTime;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}

	public static long getSerialversionuid() {
		return serialVersionUID;
	}
    

}
